package com.haima.test1;

import java.util.ArrayList;

public class t9 {
    public static void main(String[] args) {
        //学生类：创建一个学生类，该类具有学生姓名、学生年龄、学生分数等属性，以及计算学生平均分数的方法
        ArrayList<Student> list = new ArrayList<>();
        Student stu1 = new Student("张三",23,85.5);
        Student stu2 = new Student("李四",23,95.5);
        Student stu3 = new Student("王五",23,75.5);
        Student stu4 = new Student("强六",23,65.5);
        list.add(stu1);
        list.add(stu2);
        list.add(stu3);
        list.add(stu4);
        stu1.setList(list);
        stu2.setList(list);
        stu3.setList(list);
        stu4.setList(list);

        stu1.getAverage();
        stu2.getAverage();
        stu3.getAverage();
        stu4.getAverage();
    }
}
